const BaseService = require("./BaseService.js")

class PeriodicalService extends BaseService {
  // 期刊列表
  async list(params){
    let model = this.Db('periodical');
    // 期刊名称
    if(params.name){
      model = model.where('name','like',`%${params.name}%`)
    }
    // 列表
    let result = await model.page(params.current,params.size).select();
    // 总条数
    let totalCount = await model.count()
		return {
      list: result,
      totalCount
    }
  }
}

module.exports = PeriodicalService;